﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebApplication1.WebForm4" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:Label ID="Label1" runat="server" Text="姓名:"></asp:Label><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="姓名不能为空!!" ControlToValidate="TextBox1" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="姓名不能为admin!!" ControlToValidate="TextBox1" OnServerValidate="CustomValidator1_ServerValidate" Display="Dynamic"></asp:CustomValidator>
            <br />
            <asp:Label ID="Label2" runat="server" Text="密码:"></asp:Label><asp:TextBox ID="TextBox2" runat="server" TextMode="Password"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="密码不能为空!!" ControlToValidate="TextBox2" Display="Dynamic"></asp:RequiredFieldValidator>
            <br />
            <asp:Label ID="Label3" runat="server" Text="请再次输入密码:"></asp:Label><asp:TextBox ID="TextBox3" runat="server" TextMode="Password"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="密码不能为空!!" ControlToValidate="TextBox3" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="俩次输入的密码不一致!!" ControlToCompare="TextBox2" ControlToValidate="TextBox3"></asp:CompareValidator>
            <br />
            <asp:Label ID="Label4" runat="server" Text="年龄:"></asp:Label><asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
            <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="年龄范围必须在0-100之间" ControlToValidate="TextBox4" MaximumValue="100" MinimumValue="0" Type="Integer"></asp:RangeValidator>
            <br />
            <asp:Label ID="Label5" runat="server" Text="出生日期:"></asp:Label><asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="出生日期格式不正确，正确格式为:2000-01-01" ControlToValidate="TextBox5" ValidationExpressio="\d{4}-\d{2}-\d{2}"></asp:RegularExpressionValidator>
            <br />
            <asp:Label ID="Label6" runat="server" Text="毕业日期:"></asp:Label><asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
            <asp:CompareValidator ID="CompareValidator2" runat="server" ErrorMessage="毕业日期不能早于出生日期!!" ControlToCompare="TextBox5" ControlToValidate="TextBox6" Operator="GreaterThan"></asp:CompareValidator>
            <br />
            <asp:Label ID="Label7" runat="server" Text="电子邮箱:"></asp:Label><asp:TextBox ID="TextBox7" runat="server"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="邮箱格式不正确!!" ControlToValidate="TextBox7" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
            <br />
            <asp:Button ID="Button1" runat="server" Text="提交" OnClick="Button1_Click"/>
            <br />
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="List" ShowMessageBox="true"/>
            <br />
            <asp:Literal ID="Literal1" runat="server" ></asp:Literal>
        </div>
    </form>
</body>
</html>
